import { doctorLikeAPI } from "@/apis/doctor"

export const useDoctorLike = (type = 'doc') => {
	// 关注医生功能
	const onDoctorLike = async (item) => {
		uni.showLoading({
					title: '关注中....'
				})
				// 发送请求
				await doctorLikeAPI(item.id)
				// 修改页面的关注状态
				item.likeFlag = item.likeFlag === 1 ? 0 : 1
				// 关闭loading
				uni.hideLoading()
	}
	return {
		onDoctorLike
	}
}